This specification relates to compiling source code.
A compiler is a computer program that converts source code files written in a programming language into an output having a target language. The target language is often machine-readable code that can be executed by a processor.
Compiling source code files is often a time-consuming process. In large build systems, time spent compiling source code often has a non-trivial impact on the throughput of the system.
A compilation cache can improve compile times by maintaining information about compilation targets that have already been compiled. If the compilation cache indicates that a particular compilation target has already been generated, a build system need not recompile the files used to generate the compilation target.
However, even sophisticated build systems and compilers suffer from significant inefficiencies when compiling source code with a compilation cache. For example, parsing source code files at all is generally done with at least a sophisticated preprocessor, which is usually a computationally expensive operation. Furthermore, compilation caches rely on build utilities to determine which files are needed for a compilation target, but build systems generally do not analyze which files are actually required and not required to build compilation targets. Thus, many build systems recompile files needlessly over and over again.